package com.rockcent.mall.lib.repository;

import com.rockcent.common.domain.enumclass.Whether;
import com.rockcent.mall.lib.domain.UserMall;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by DK on 17/3/29.
 */
@Repository
public interface UserMallRepository extends JpaRepository<UserMall, Long>, JpaSpecificationExecutor, UserMallRepositoryCustom {

    UserMall findByMallIdAndUserId(Long mallId, Long userInfoId);

    List<UserMall> findByUserIdAndAvailable(Long userId, Whether whether);

    List<UserMall> findByTitleId(Long id);

    List<UserMall> findByMallId(Long mallId);

    List<UserMall> findByMallIdAndIsSuperAdmin(Long mallId, Whether isSuperAdmin);
}
